package com.hyb.service.impl;

import com.hyb.mapper.UserMapper;
import com.hyb.pojo.User;
import com.hyb.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;

    public User getUserByName(String username) {
        User user = new User();
        user.setUsername(username);
        return userMapper.selectUserByName(user);
    }

    public User getUserById(int id) {
        User user = new User();
        user.setId(id);
        return userMapper.selectUserById(user);
    }
}
